#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include "vector.h"
using namespace std;
void VectorTest01()
{
	wang::vector<int> v({1,2,3,4});
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);
	v.push_back(6);
	v.push_back(7);
	for (int i = 0; i < v.size(); i++)
	{
		cout << v[i] << " ";
	}
	cout << endl;
	//迭代器遍历
	wang::vector<int>::iterator it1 = v.begin();
	while (it1 != v.end())
	{
		cout << *it1 << " ";
		it1++;
	}
	cout << endl;
	//范围for遍历
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;
}
void VectorTest02()
{
	wang::vector<int> v({ 1,2,3,4,5 });
	wang::vector<int> v1(v);
	//范围for遍历
	for (auto e : v1)
	{
		cout << e << " ";
	}
	cout << endl;
}
void VectorTest03()
{
	wang::vector<int> v(0,1);
	wang::vector<int> v1 = v;
	for (auto e : v1)
	{
		cout << e << " ";
	}
	cout << endl;
}
void VectorTest04()
{
	string s("hello");
	wang::vector<int> v(s.begin(), s.end());
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;
}
int main()
{
	VectorTest04();
	return 0;
}
